<?php
namespace app\passport\controller;

class Register
{
	public function index()
	{
		return '<style type="text/css">*{ padding: 0; margin: 0; } .think_default_text{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p> Tuduweb 2016<br/><span style="font-size:30px">优雅的处理每一行代码</span></p><span style="font-size:22px;">[ 用户模块 - 注册 ]</span></div>';
	}

	public function web()
	{
		//用户网页端注册页面
	}

	public function moblie()
	{
		//用户手机端注册页面
	}

	public function test()
	{
		//发送邮件的测试	
	    \think\Loader::import("aliyun-php-sdk-core.Config");

	    $iClientProfile = \DefaultProfile::getProfile("cn-hangzhou", "LTAIHO4OKX6TCerD", "grzjt014YIyS9zolHtb6nYWysT6k2K");        
	    $client = new \DefaultAcsClient($iClientProfile);    
	    $request = new \Dm\Request\V20151123\SingleSendMailRequest();
	    $request->setAccountName("uc@i.tuduweb.com");
	    $request->setFromAlias("bin");//发信人昵称
	    $request->setAddressType(1);
	    $request->setTagName("register");
	    $request->setReplyToAddress("true");
	    $request->setToAddress("dsdasdaweasdad@qq.com");
	    $request->setSubject("主题测试");
	    $request->setHtmlBody("邮件正文");        
	    try {
	        $response = $client->getAcsResponse($request);
	        print_r($response);
	    }
	    catch (ClientException  $e) {
	        print_r($e->getErrorCode());
	        print_r($e->getErrorMessage());
	    }
	    catch (ServerException  $e) {
	        print_r($e->getErrorCode());
	        print_r($e->getErrorMessage());
	    }
	}
}
